package dd.control;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import xml.Message;
import dd.model.Model;
import dd.view.MainScreen;

public class EventsRequestController implements ActionListener {

	private MainScreen mainScreen;

	public EventsRequestController(MainScreen mainScreen) {
		this.mainScreen = mainScreen;
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		Model.getInstance().setMainScreen(mainScreen);

		String xmlString = Message.requestHeader() + "<eventsRequest/></request>";
		Message m = new Message(xmlString);
		Model.getInstance().getServerAccess().sendRequest(m);
	}
}
